package thread;

public class RunnableTest implements Runnable {

    public void run() {
        //启动线程后要执行的内容
        System.out.println("开始执行线程："+Thread.currentThread().getName());
        int count =0;
        for(int i=0;i<10;i++){
            count ++;
            System.out.println("count:"+count);
        }
        System.out.println("结束执行线程："+Thread.currentThread().getName());
    }

    public static void main(String[] args) {
        //调用thread类中指定runnable接口
        Thread thread =new Thread(new RunnableTest());
        //启动线程
        thread.start();
    }
}
